import axios from "../../../utils/axios";

// 获取志愿服务轮播图列表
export const getVolunteerBanner = () => {
    return axios({
        method: 'get',
        url: '/prod-api/api/volunteer-service/ad-banner/list',
        headers: {
            Authorization: window.localStorage.getItem("token")
        }
    })
}

// 分页查询所有新闻列表
export const getVolunteerNews = ({ pageNum, pageSize }: any) => {
    return axios({
        method: 'get',
        url: `/prod-api/api/volunteer-service/news/list?pageNum=${pageNum}&pageSize=${pageSize}`,
        headers: {
            Authorization: window.localStorage.getItem("token")
        }
    })
}

// 查询新闻详情
export const getVolunteerNewsDetail = (id: any) => {
    return axios({
        method: 'get',
        url: `/prod-api/api/volunteer-service/news/${id}`
    })
}

// 分页查询所有志愿活动列表
export const getVolunteerActivityList = ({ pageNum, pageSize }: any) => {
    return axios({
        method: 'get',
        url: `/prod-api/api/volunteer-service/activity/list?pageSize=${pageSize}&pageNum=${pageNum}`
    })
}

// 查询活动详情
export const getVolunteerActivityDetail = (id: any) => {
    return axios({
        method: 'get',
        url: `/prod-api/api/volunteer-service/activity/${id}`
    })
}

// 报名/取消报名某场志愿活动
export const VolunteerRegister = (data: any) => {
    return axios({
        method: 'post',
        url: '/prod-api/api/volunteer-service/register',
        data,
    })
}